package computerstudent;

public class comstd {
    public static class Computer {
        private String brand;
        private String model;
        private String cpu;
        private int memory;
        private int storage;

        public Computer(String brand, String model, String cpu, int memory, int storage) {
            this.brand = brand;
            this.model = model;
            this.cpu = cpu;
            this.memory = memory;
            this.storage = storage;
        }

        public String getComputerConfig() {
            return "Brand: " + brand + ", Model: " + model + ", CPU: " + cpu + ", Memory: " + memory + "GB, Storage: " + storage + "GB";
        }
    }

    public static class Student {
        private String name;
        private String studentId;
        private Computer computer;

        public Student(String name, String studentId) {
            this.name = name;
            this.studentId = studentId;
        }

        public void setComputer(Computer computer) {
            this.computer = computer;
        }

        public void displayComputerConfig() {
            if (computer != null) {
                System.out.println("Student: " + name + ", ID: " + studentId + ", Computer: " + computer.getComputerConfig());
            } else {
                System.out.println("Student: " + name + ", ID: " + studentId + " does not have a computer assigned.");
            }
        }
    }

    public static class Main {
        public static void main(String[] args) {
            Computer computer1 = new Computer("HP", "Spectre x360", "i7", 16, 512);
            Computer computer2 = new Computer("Lenovo", "ThinkPad T14p", "i9", 32, 1024);
            Computer computer3 = new Computer("Dell", "XPS 16", "Ultra9-185H", 64, 2048);

            Student student1 = new Student("Orlena", "S001");
            Student student2 = new Student("Serpentia", "S002");
            Student student3 = new Student("Vulpis", "S003");
           
            student1.setComputer(computer1);
            student2.setComputer(computer2);
            student3.setComputer(computer3);

            student1.displayComputerConfig();
            student2.displayComputerConfig();
            student3.displayComputerConfig();
        }
    }

}
